package com.zfk.transaction.service.impl;

import com.zfk.transaction.entity.home.*;
import com.zfk.transaction.mapper.HomeMapper;
import com.zfk.transaction.service.HomeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class HomeServiceImpl implements HomeService {

    @Autowired
    private HomeMapper homeMapper;

    @Override
    public ResultBean getHomeData() {

        // 得到主页的数据
        List<ActInfo> allAct = homeMapper.getAllAct();
        List<BannerInfo> allBanner = homeMapper.getAllBanner();
        List<ChannelInfo> allChannel = homeMapper.getAllChannel();
        List<RecommendInfo> allRecommend = homeMapper.getAllRecommend();

        ResultBean resultBean = new ResultBean(allAct,allBanner,allChannel,allRecommend);

        return resultBean;
    }
}
